using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using minims_lib;

namespace minims_cmd
{
	class Program
	{

		static void Main(string[] args)
		{
			if (args.Length > 0)
			{
				MinimsServer Server;
				MinimsConfig Config;

				FileInfo bin = new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);

				if (!bin.Exists)
					return;

				Config = new MinimsConfig();
				Config.Load(bin.DirectoryName + "\\config\\");

				Server = new MinimsServer();

				List<string> folders = new List<string>();
				foreach (string f in args)
				{
					// Validate path
					folders.Add(f);
				}

				Server.Start(bin.DirectoryName + "\\config\\");
				Server.UpdateContent(folders);
			}
		}
	}
}